package com.hyxt.boot;


import com.hyxt.consumer.ServiceAdapter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;


@SpringBootApplication
public class ClientApplication {

    public static void main(String[] args) {
        // 程序启动入口
        // 启动嵌入式的 Tomcat 并初始化 Spring 环境及其各 Spring 组件
        ConfigurableApplicationContext run = SpringApplication.run(ClientApplication.class, args);
        ServiceAdapter demoService = run.getBean(ServiceAdapter.class);
       demoService.setString("huayou","zhangcx早上好！！！",0);
       System.out.println("缓存中获得的数据为："+demoService.getString("huayou",0));
        /*UserEntity user = new UserEntity();
        user.setUserId(113445);
        user.setSex(1);
        user.setUname("小祥");
        user.setUnick("zhangcx");
        user.setEmail("zhangcx@mogujie.com");
        demoService.getHello("zhangcx");
        System.out.println(demoService.setString("zhangcx","good"));
        if(demoService.setString("zhangcx","test")){
            System.out.println("String缓存推入数据成功！！！");
        }else{
            System.out.println("String缓存推入数据失败！！！");
        }
        System.out.println(demoService.setObject("zhang",user));
        if(demoService.setObject("zhang",user)){
            System.out.println("Object缓存推入数据成功！！！");
        }else{
            System.out.println("Object缓存推入数据失败！！！");
        }
        System.out.println(demoService.getString("zhangcx"));
        try {
            UserEntity user1 = demoService.getObject("zhang",UserEntity.class);
            System.out.println(user1.getUname());
        }catch (Exception e ){

        }*/
        //向频道发送消息测试
        //demoService.sendMessage("gps.realtime","早上好小祥!!");
        //删除数据测试
        //demoService.delete("zhangcx");

    }
}
